<?php

namespace app\common\model\logic;

use RongCloud\RongCloud;

class RongyunModel
{
    public function __construct()
    {
        $this->rongyun = new RongCloud('lmxuhwagluoud', '4pDntDwNMeH');
    }

    public function getUserToken($userId)
    {
        $portrait = 'http://7xogjk.com1.z0.glb.clouddn.com/IuDkFprSQ1493563384017406982';
        $User = $this->rongyun->getUser();

        $params = [
            'id' => 'ujadk90had', //用户id
            'name' => 'test', //用户名称
            'portrait' => $portrait, //用户头像
        ];
        $userInfo = $User->register($params);

        return $userInfo;
    }
}
